package config

import (
	"fmt"
	"goadmin-huasen-portal/cache"
	"os"

	"github.com/spf13/viper"
)

type Config struct {
	Name    string
	Host    string
	Port    string
	Timeout int64
	Env     string
	Mysql   cache.Config
}

func LoadSettingFile() {
	workDir, _ := os.Getwd()
	viper.SetConfigName("main-api")
	viper.SetConfigType("yaml")
	viper.AddConfigPath(workDir + "/etc")

	if err := viper.ReadInConfig(); err != nil {
		fmt.Println("read main-api.yaml error :", err)
	}

}
